<?php
$_POST['SUMValues'] = 0;
$_POST['AritmContr'] = 0;
echo '<script charset="utf-8" type="text/javascript">document.InvoiceProperties.action=\'_response/call.php?get=Operative/exe_inv/exe_registred.mex\';</script>';
?>
<?php mn_field('button', 'ED', 'CloseSerials', $lang['func']['minimize'] . ' ' . $lang['XFK0WK2A']['serial_reg'], '', '', '', '" onclick="
	document.InvoiceProperties.action=\'_response/call.php?get=Operative/blank_reg\';
	subform(\'InvoiceProperties\',\'cur_serials\');'); ?>
<table width="100%" border="0" cellpadding="1" cellspacing="1">
    <tr>
        <td valign="top" bgcolor="#F2F2F2">Valores n�o sujeitos a registo:</td>
        <?php
        $CURValues = $MYT->db_array("SELECT cur_values.REF, cur_values.CURRENCY, cur_values.VALUE, cur_values.TYPE FROM hd_monedasiso
	  							INNER JOIN cur_checks ON cur_checks.CURRENCY = miso_Cod_elite
								INNER JOIN cur_values ON cur_checks.CURRENCY_ISO = cur_values.CURRENCY
								WHERE miso_Cod_elite = {$_POST['FraCalcISO']}
								AND STATUS = 1
								AND COMP_SERVICE = 1
								AND cur_values.REF <= cur_checks.VALUE");

        for ($t = 1; $t <= $CURValues[0]; $t++) {
            $tl = $t - 1;

            if ($t == 1) {
                echo '<td bgcolor="#F2F2F2" width="33%" valign="top">Moedas
	  <table width="100%"  border="0" cellspacing="3" cellpadding="1">';
            } elseif ($CURValues[$t]['TYPE'] != $CURValues[$tl]['TYPE']) {
                $SecColumn = 1;
                echo '</table>
	  </td><td bgcolor="#F2F2F2" width="33%" valign="top">Notas<table width="100%"  border="0" cellspacing="3" cellpadding="1">';
            }
            echo '<tr bgcolor="#DBEBD6">
	 <td>' . $CURValues[$t]['CURRENCY'];
            mn_field('text', 'ED', 'VALUE' . $t, $CURValues[$t]['VALUE'], '8', '3', 'False', '" readonly="');
            mn_field('text', 'ED', 'QUANT' . $t, '0', '8', '3', 'False', 'INPNUM"
					onKeyUp="document.InvoiceProperties.action=\'_response/call.php?get=Operative/exe_inv/exe_registred.mex\';
					subform(\'InvoiceProperties\',\'Exc_registred\');');
            mn_field('hidden', 'ED', 'AritmContr', $t, '', '', '', '');
            echo '</td>
      </tr>';
            if ($t == $CURValues[0]) {
                echo '</table></td>';
                if (!isset($SecColumn)) {
                    echo '<td bgcolor="#F2F2F2" width="33%" valign="top">Notas</td>';
                }
            }
        }
        mn_field('hidden', 'ED', 'SUMValues', $_POST['SUMValues'], '', '', '', '');
        ?>
    </tr>
    <tr>
        <td valign="top" bgcolor="#F2F2F2"><?php echo $lang['XFK0WK2A']['serial_reg']; ?>:</td>
        <td bgcolor="#F2F2F2" colspan="2">
            <div id="Exc_registred"><?php include("exe_inv/exe_registred.mex"); ?></div>
        </td>
    </tr>
</table>